Skip to content

Warn when compose wait strategy names don't match containers#1232

Merged
cristianrgreco merged 4 commits intomainfrom
codex/issue-837-compose-wait-strategy-validation
Feb 17, 2026
Merged

Warn when compose wait strategy names don't match containers#1232
cristianrgreco merged 4 commits intomainfrom
codex/issue-837-compose-wait-strategy-validation

Conversation

@cristianrgreco
Copy link
Copy Markdown
Collaborator

Summary of changes

  • Add a warning in DockerComposeEnvironment.up() when withWaitStrategy(...) names do not match any started containers.
  • Keep behavior non-breaking: unmatched entries are still ignored, but now produce a clear warning explaining container-name matching.
  • Add an integration test that verifies the warning is emitted for an unmatched wait strategy key.
  • Update compose docs to clarify that:
    • .up([...]) takes service names
    • .withWaitStrategy(...) takes container names (for example <service>-1 in Compose v2)

Verification commands run

  • npm run format
  • npm run lint
  • npm test -- packages/testcontainers/src/docker-compose-environment/docker-compose-environment.test.ts -t "should warn when no started containers match configured wait strategy names"

Test results summary

  • Formatting and linting completed successfully.
  • Targeted Docker Compose integration test passed (1 passed, 24 skipped).

Closes #837

@cristianrgreco cristianrgreco added bug Something isn't working patch Backward compatible bug fix labels Feb 17, 2026
@netlify
Copy link
Copy Markdown

netlify bot commented Feb 17, 2026

Deploy Preview for testcontainers-node ready!

Name Link
🔨 Latest commit f76a417
🔍 Latest deploy log https://app.netlify.com/projects/testcontainers-node/deploys/6994903c1951380008f9589e
😎 Deploy Preview https://deploy-preview-1232--testcontainers-node.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@cristianrgreco cristianrgreco added enhancement New feature or request minor Backward compatible functionality and removed bug Something isn't working patch Backward compatible bug fix labels Feb 17, 2026
@cristianrgreco cristianrgreco force-pushed the codex/issue-837-compose-wait-strategy-validation branch from f7e1e0a to f76a417 Compare February 17, 2026 15:58
@cristianrgreco cristianrgreco merged commit 84d0908 into main Feb 17, 2026
340 checks passed
@cristianrgreco cristianrgreco deleted the codex/issue-837-compose-wait-strategy-validation branch February 17, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request minor Backward compatible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DockerComposeEnvironment missing validation for wait strategies?

1 participant